package co.fitstart.entity.principal;

import com.demo2do.core.utils.Alias;

@Alias("PrincipalType")
public enum PrincipalType {
    
    NORMAL("normal", "普通员工"),
    
    SITE("site", "门店员工");
    
    private String alias;
    
    private String description;
    
    private PrincipalType(String alias, String description) {
        this.description = description;
        this.alias = alias;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static PrincipalType aliasOf(String alias) {
        for (PrincipalType principalType : PrincipalType.values()){
            if (principalType.getAlias().equalsIgnoreCase(alias)) {
                return principalType;
            }
        }
        return null;
        
    }
    
    public boolean isNormal() {
        return this.equals(NORMAL);
    }
    
    public boolean isSite() {
        return this.equals(SITE);
    }
    
    /**
     * 
     * @return
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * @return
     */
    public String getDescription() {
        return description;
    }
}
